<template>
  <div>
    <!-- <el-dialog :visible.sync="dialogPictureVisible" fullscreen>
      <img :src="dialogImageUrl" alt="dialogImageUrl" style="margin: 0 auto;" />
    </el-dialog>-->

    <div class="pagebg ab"></div>
    <div class="container">
      <h1 class="t_nav">
        <span>让努力变成一种习惯</span>
        <a href="/" class="n1">网站首页</a>
        <a href="/" class="n2">关于我</a>
      </h1>
      <div class="news_infos">
        <div class="news_con fixck newsview ck-content"></div>
        <el-divider></el-divider>

        <!--        <sticky :sticky-top="60">-->
        <CommentBox></CommentBox>
        <div class="message_infos">
          <CommentList></CommentList>
          <div class="noComment" v-if="comments.length==0">还没有评论，快来抢沙发吧！</div>
        </div>
      </div>
      <div class="sidebar">
        <div class="about">
          <p class="avatar">
            <img :src="info.photoList[0]" alt />
          </p>
          <p class="abname">{{info.nickName}}</p>
          <p class="abposition">{{info.occupation}}</p>
          <p class="abtext">{{info.summary}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import CommentBox from "../components/CommentBox";
import CommentList from "../components/CommentList";
export default {
  components: {
    CommentBox,
    CommentList
  },
  data() {
    return {
      info: {
        photoList: [
          "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2381544305,2153377697&fm=26&gp=0.jpg"
        ],
        nickName: "蒙家辉",
        occupation: "Java后台开发",
        summary:
          "大学学生，java后台方向，热爱编程，不断学习，永远怀着一颗不满足的心"
      },
      comments:[]
    };
  },
  mounted(){
    let session=window.localStorage
    let comments=JSON.parse(session.getItem("comments"))
    this.comments=comments==null?[]:comments
  }
};
</script>

<style>
.commentStyle {
  display: block;
  margin-top: 10px;
  margin-left: 10px;
  border-left: 1px dashed SlateGray;
}
.comment {
  display: none;
}
.commentList {
  width: 100%;
  margin: 0 auto;
}
.commentList .p1 {
  float: left;
}
.commentList .left {
  display: inline-block;
  width: 5%;
  height: 100%;
}
.commentList .left img {
  margin: 0 auto;
  width: 100%;
  border-radius: 50%;
}
.commentList .right {
  display: inline-block;
  width: 93%;
  margin-left: 5px;
}
.commentList .rightTop {
  height: 30px;
  margin-top: 2px;
}
.commentList .rightTop .userName {
  color: #303133;
  margin-left: 10px;
  font-size: 16px;
  font-weight: bold;
}
.commentList .rightTop .timeAgo {
  color: #909399;
  margin-left: 10px;
  font-size: 15px;
}
.commentList .rightCenter {
  margin-left: 20px;
  height: 50px;
  margin-top: 15px;
}
.commentList .rightBottom {
  margin-left: 10px;
  height: 30px;
}
.commentList .rightBottom el-link {
}
.commentList .rightBottom .b1 {
  margin-left: 10px;
}
</style>